<?php
require_once(FWK_MODEL."AbsComponente.class.php");


class Combobox extends AbsComponente{
	
	private $objDaoComp;
	private $strMetodoDao;
	
	public function setDaoComp($daoComp){
		require_once(PASTA_DAO.$daoComp.".class.php");
		
		$this->objDaoComp = new $daoComp();
	}
	
	public function getDaoComp(){
		return $this->objDaoComp;
	}
	
	public function setMetodoDao($strMetodoDao){
		$this->strMetodoDao = $strMetodoDao;
	}
	
	public function getMetodoDao(){
		return $this->strMetodoDao;
	}
	
	public function setTxtDefault($txtDefault){
		$this->txtDefault = $txtDefault;
	}
	
	public function getTxtDefault(){
		return $this->txtDefault;
	}


	public function getComponente($value = null){
		$arrDados = self::getDaoComp()->getDadosCombo();
		$arrDados = Utf8Parsers::matrizUtf8Encode($arrDados);
		parent::getObjSmarty()->assign("OPT_INICIAL",$this->txtDefault);
		parent::getObjSmarty()->assign("VALUE_COMP",$value);
		parent::getObjSmarty()->assign("ARR_DADOS",$arrDados);
		$strTela = parent::getObjSmarty()->fetch("../".TPLS_FWK."combobox.tpl");
		print($strTela);
	}

}